<div data-dux="table-bind">
    <div class="dux-page-header am-cf">
        <div class="page-title">
            <form class="am-form-inline" method="get" action="{url()}">
                <div class="am-form-group">
                    <input type="text" name="keyword" class="am-form-field" value="{$pageMaps.keyword}"
                           placeholder="搜索">
                </div>
                <div class="am-form-group">
                    <select class="am-form-field" name="status">
                        <option value="3">全部</option>
                        <option value="1" <!--if{$pageMaps.type == 1}-->selected <!--{/if}-->>已上架</option>
                        <option value="2" <!--if{$pageMaps.type == 2}-->selected <!--{/if}-->>已下架</option>
                    </select>
                </div>
                <div class="am-form-group">
                    <button type="submit" class="am-btn am-btn-primary am-icon-search"></button>
                </div>
            </form>
        </div>

        <div class="page-action">
            <a class="am-btn am-btn-primary" href="{url('add')}">添加</a>
        </div>
    </div>
    <div class="dux-page-table">
        <table class="am-table dux-table" data-table>
            <thead>
            <tr>
                <th width="100">#</th>
                <th>名称</th>
                <th>类型</th>
                <th>面额</th>
                <th>满减</th>
                <th>兑换价格</th>
                <th>发放时间</th>
                <th class="am-text-center" width="100">状态</th>
                <th class="am-text-center" width="150">管理</th>
            </tr>
            </thead>
            <tbody>
            <!--loop{$list as $vo}-->
            <tr>
                <td>
                    {$vo.coupon_id}
                </td>
                <td>
                    <a href="{$vo.url ? $vo.url : ROOT_URL . '/'}" target="_blank">{$vo.name}</a>
                </td>
                <td>
                    {$vo.type=='common' ? '通用': $typeList[$vo.type]['name']}
                </td>
                <td>
                    ￥{$vo.money}
                </td>
                <td>
                    ￥{$vo.meet_money}
                </td>
                <td>
                    {$vo.exchange_price} {$currencyList[$vo.exchange_type]['name']}
                </td>
                <td>
                    <div>{date('Y-m-d H:i', $vo.start_time)}</div>
                    <div>{date('Y-m-d H:i', $vo.end_time)}</div>
                </td>

                <td class="am-text-center">
                    <!--if{$vo.status}-->
                    <span data-id="{$vo.coupon_id}" data-name="status" data-url="{url('status')}" data-status="1" class="am-text-success am-icon-circle"></span>
                    <!--{else}-->
                    <span data-id="{$vo.coupon_id}" data-name="status" data-url="{url('status')}" data-status="0" class="am-text-danger am-icon-circle"></span>
                    <!--{/if}-->
                </td>
                <td class="am-text-center">
                    <a class="am-btn am-btn-primary am-btn-xs" title="编辑" href="{url('edit', ['id'=>$vo['coupon_id']])}"><i class="am-icon-edit"></i></a>
                    <a class="am-btn am-btn-danger am-btn-xs" href="javascript:;"
                       data-url="{url('del')}" data-id="{$vo.coupon_id}" title="删除" data-del><i
                            class=" am-icon-trash"></i></a>
                </td>
            </tr>
            <!--{/loop}-->
            </tbody>
        </table>
    </div>
    <div class="dux-page-foot am-cf">
        {$page}
    </div>
</div>